﻿using System;
using System.Runtime.Serialization;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SCABaselineCS.Tests.Reliability
{
    [TestClass]
    public class SerializableTests
    {
        // these are the result of a specific product's alert that my custom Exception doesn't have [Serializable], even though
        //  it inherits from Exception, which implements ISerializable.
        // not quite sure yet how to address the unit tests.

        public class MySerializable_WithoutAttribute : System.Runtime.Serialization.ISerializable
        {
            public void GetObjectData(SerializationInfo info, StreamingContext context) { /* do nothing */ }
        }

        [Serializable]
        public class MySerializable_WithAttribute : System.Runtime.Serialization.ISerializable
        {
            public void GetObjectData(SerializationInfo info, StreamingContext context) { /* do nothing */ }
        }

        public class MyNonserializableObject_InheritsFromSerializableWithAttribute : MySerializable_WithAttribute { }
        public class MyNonserializableObject_InheritsFromSerializableWithoutAttribute : MySerializable_WithoutAttribute { }

        // Exception implements ISerializable
        public class MyException_NotSerializable : Exception { }

        // should not cause an issue
        [Serializable]
        public class MyException_Serializable : Exception { }


        //[TestMethod]
        public void TestMethod1()
        {
            // TODO
        }

    } // class
} // namespace